<template>
  <div class="user">
    <Profile  v-if='isLogin' />
    <LoginOrReg v-else />
  </div>
</template>

<script lang="ts">
import Vue from 'vue'
import LoginOrReg from './Login&Reg/LoginOrReg.vue'
import Profile from './Profile/Profile.vue'
export default Vue.extend({
  name: "User",
  components: {
    LoginOrReg,
    Profile,
  },
  data: () => ({
    isLogin: false
  }),
  mounted(){
    window.scrollTo(0,0)
    const token = localStorage.getItem('token')
    if(token){
      this.isLogin = true
    }
  }
})
</script>

<style lang="scss">
.user {
  padding: 2vh 2vw;
  min-height: 100vh;
  background-image: linear-gradient(to top, #a8edea 0%, #fed6e3 100%);
}
</style>